Repository navigation
Fix agentic review publication and PR input contracts - #12190
Conversation
Consume typed history-link fragments directly in custom footers and regenerate the affected workflows. Restore public-only unapproved PR reads for expert review with shell access disabled, resolve centralized command identity, and emit terminal incomplete results for unavailable diffs. Add pinned-runtime regression coverage and document red/green evidence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
The change is mechanical and consistent, and I found no blocking issues. Coverage was limited: the 742KB diff file was not readable in this run, so I reviewed the PR metadata and the non-lock source files from the local checkout of the head commit. I did not hand-review the 30+ regenerated *.lock.yml files.
Reviewer actions
- Recommended: confirm on a live run that a public PR with an unapproved author can be read through
min-integrity: noneand thatbash: falseis actually applied in the generated lock files ofreview.agent,review-on-open.agentandreview-after-autofix.agent. Done when: a dispatched review completes, orreport_incompletefires, as intended. The PR itself says no live dispatch was done. - Recommended: check that
REVIEW_PR_NUMBERresolves to a PR number when the/reviewcommand is triggered from anissue_commenton a plain issue, or has no PR context. Done when: that path ends in a terminalreport_incompleterather than reviewing the wrong number.
Change classification
- Agentic workflow footer templates:
{history_link}is now consumed directly, with the· [◷](...)wrapper removed, in about 32 workflow sources and their locks. - Expert-review workflow input contract in
shared/review-shared.md:bash: false,min-integrity: none,allowed-repos: public,REVIEW_PR_NUMBER, and a terminal incomplete path when the diff is unavailable. - New offline test
.github/scripts/test_gh_aw_runtime_contracts.py, wired intocheck-action-pins.yml, plus a README section.
Confidence at a glance
🟡 Build, dependencies & scripts
- No dependency versions, action pins or containers changed, according to the PR description. I did not verify this, and
check_action_pins.pyis the authoritative guard. - The new test is added to both
pathstriggers and to a CI step, so it will run. - Footer edits in the
.mdsources are one-line and uniform, as sampled.
🟡 Security / agentic workflow policy
- Reading unapproved public PR content with
min-integrity: noneraises the prompt-injection exposure. The mitigations are visible in the diff:bash: false,allowed-repos: public, an explicit instruction to treat the diff as untrusted data, and safe-output limits. Maintainers should explicitly accept this trade-off. Confirm that credentials in the job cannot be reached through the remaining tools. fromJSON(...)inside the frontmatterenvexpression falls back toitem_number. This is acceptable given the README rationale, but it should be covered by the compiled-prompt regression test, which the PR claims it is.
🟢 Test-value evidence
- The PR provides paired red/green evidence (2 tests fail on the baseline and pass with the fix). Two of the three contracts are static checks only. Hosted behavior remains unverified, and the PR states this.
Specialists for MSTest/MTP product code were not applicable: no .NET product, public API, localization or test-project files changed.
There was a problem hiding this comment.
🔵 Needs a closer look
The relaxed public-PR trust boundary and background-review lifecycle require maintainer validation because offline fixtures cannot establish hosted enforcement or live completion and publication.
No open issues 🎉
What changed in this PR
This PR repairs publication and PR-input handling in TestFx’s agentic workflows without changing shipped .NET products. It corrects footer composition and lets expert reviews consume unapproved public PR data while retaining restricted tooling.
Changes:
- Insert
{history_link}directly as an optional inline fragment and update generated workflow locks. - Resolve centralized
/reviewPR identity through an environment binding, disable shell access, and require an incomplete result when the diff is unavailable. - Wire runtime-contract regressions into CI and document the rationale and validation limits.
Test-value evidence: For revision d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6, the PR reports two targeted regressions failing against the baseline and passing with the fix, plus 77 passing test methods overall. These results were not independently rerun; hosted model behavior, publication permissions, and GitHub UI rendering remain unverified.
| File | Description |
|---|---|
.github/workflows/weekly-issue-activity.md |
Corrects the weekly summary footer. |
.github/workflows/weekly-issue-activity.lock.yml |
Updates compiled weekly summary footers. |
.github/workflows/unskip-closed-tests.lock.yml |
Updates compiled unskip workflow footers. |
.github/workflows/unskip-closed-tests-shared.md |
Corrects the shared unskip footer. |
.github/workflows/test-reviewer.agent.md |
Corrects the command-triggered test-review footer. |
.github/workflows/test-reviewer.agent.lock.yml |
Updates compiled command test-review footers. |
.github/workflows/test-reviewer-on-pr.agent.md |
Corrects the automatic test-review footer. |
.github/workflows/test-reviewer-on-pr.agent.lock.yml |
Updates compiled automatic test-review footers. |
.github/workflows/test-improver.md |
Corrects the test-improver footer. |
.github/workflows/test-improver.lock.yml |
Updates compiled test-improver footers. |
.github/workflows/sub-issue-closer.md |
Corrects the sub-issue closure footer. |
.github/workflows/sub-issue-closer.lock.yml |
Updates compiled sub-issue closure footers. |
.github/workflows/shared/test-reviewer-shared.md |
Corrects the shared test-review footer. |
.github/workflows/shared/review-shared.md |
Updates PR identity, read policy, shell restrictions, and incomplete reporting. |
.github/workflows/shared/parallel-safety-audit-shared.md |
Corrects the shared parallel-safety footer. |
.github/workflows/shared/msbuild-review-shared.md |
Corrects the shared MSBuild-review footer. |
.github/workflows/shared/address-review-shared.md |
Corrects the shared review-response footer. |
.github/workflows/resource-lock-refactoring.md |
Removes the invalid history-link wrapper. |
.github/workflows/resource-lock-refactoring.lock.yml |
Updates compiled resource-lock footers. |
.github/workflows/repository-quality-improver.md |
Corrects the repository-quality footer. |
.github/workflows/repository-quality-improver.lock.yml |
Updates compiled repository-quality footers. |
.github/workflows/README.md |
Documents runtime contracts, regression evidence, and validation limits. |
.github/workflows/pr-fix.md |
Corrects the PR-fix footer. |
.github/workflows/pr-fix.lock.yml |
Updates compiled PR-fix footers. |
.github/workflows/perf-improver.md |
Corrects the performance-improver footer. |
.github/workflows/perf-improver.lock.yml |
Updates compiled performance-improver footers. |
.github/workflows/parallel-safety-audit-command.md |
Corrects the command-triggered audit footer. |
.github/workflows/parallel-safety-audit-command.lock.yml |
Updates compiled command audit footers. |
.github/workflows/mutation-test-improver.md |
Corrects the mutation-test footer. |
.github/workflows/mutation-test-improver.lock.yml |
Updates compiled mutation-test footers. |
.github/workflows/msbuild-quality-review.lock.yml |
Updates compiled MSBuild-review footers. |
.github/workflows/markdown-linter.md |
Corrects the Markdown-linter footer. |
.github/workflows/markdown-linter.lock.yml |
Updates compiled Markdown-linter footers. |
.github/workflows/malicious-code-scan.md |
Corrects the code-scan footer. |
.github/workflows/malicious-code-scan.lock.yml |
Updates compiled code-scan footers. |
.github/workflows/link-checker.md |
Corrects the link-checker footer. |
.github/workflows/link-checker.lock.yml |
Updates compiled link-checker footers. |
.github/workflows/glossary-maintainer.md |
Corrects the glossary-maintainer footer. |
.github/workflows/glossary-maintainer.lock.yml |
Updates compiled glossary-maintainer footers. |
.github/workflows/efficiency-improver.md |
Corrects the efficiency-improver footer. |
.github/workflows/efficiency-improver.lock.yml |
Updates compiled efficiency-improver footers. |
.github/workflows/duplicate-code-detector.md |
Corrects the duplicate-code report footer. |
.github/workflows/duplicate-code-detector.lock.yml |
Updates compiled duplicate-code footers. |
.github/workflows/dependabot-pr-bundler.md |
Corrects the dependency PR-bundler footer. |
.github/workflows/dependabot-pr-bundler.lock.yml |
Updates compiled PR-bundler footers. |
.github/workflows/dependabot-issue-bundler.md |
Corrects the dependency issue-bundler footer. |
.github/workflows/dependabot-issue-bundler.lock.yml |
Updates compiled issue-bundler footers. |
.github/workflows/daily-file-diet.md |
Corrects the file-diet footer. |
.github/workflows/daily-file-diet.lock.yml |
Updates compiled file-diet footers. |
.github/workflows/code-simplifier.md |
Corrects the code-simplifier footer. |
.github/workflows/code-simplifier.lock.yml |
Updates compiled code-simplifier footers. |
.github/workflows/check-action-pins.yml |
Adds runtime-contract test triggers and execution. |
.github/workflows/build-failure-analysis.md |
Corrects the automatic build-analysis footer. |
.github/workflows/build-failure-analysis.lock.yml |
Updates compiled automatic build-analysis footers. |
.github/workflows/build-failure-analysis-command.md |
Corrects the command-triggered build-analysis footer. |
.github/workflows/build-failure-analysis-command.lock.yml |
Updates compiled command build-analysis footers. |
.github/workflows/autofix.agent.md |
Corrects the autofix footer. |
.github/workflows/autofix.agent.lock.yml |
Updates compiled autofix footers. |
.github/workflows/adhoc-qa.md |
Corrects the ad hoc QA footer. |
.github/workflows/adhoc-qa.lock.yml |
Updates compiled ad hoc QA footers. |
.github/workflows/address-review.agent.md |
Corrects the automatic review-response footer. |
.github/workflows/address-review.agent.lock.yml |
Updates compiled review-response footers. |
.github/workflows/add-tests.md |
Corrects the test-generation footer. |
.github/workflows/add-tests.lock.yml |
Updates compiled test-generation footers. |
Review effort: Balanced
There was a problem hiding this comment.
🧪 Test quality review — PR #12190
Compared merge base d9e38dc463365dc12f714db14815b46dedb0ed15 with head d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6. Evidence applies to this head, not every intermediate commit.
Test-value evidence
- The diff changes only agentic workflow sources (
.md), regenerated.lock.ymlfiles,.github/workflows/README.md,check-action-pins.yml, and.github/scripts/test_gh_aw_runtime_contracts.py. It has no C# test or product-source changes. - Contract: gh-aw workflow runtime/compile output. The existing Python contract script is the only related test. It was not run in this read-only review, so there is no executed before/after evidence. Status: unverified / not executed.
- Lock-file changes are generated output and are not applicable for regression tests.
python .github/scripts/check_action_pins.pyand the CI pin audit remain the guard for unintendeduses:changes. - The Python script appears in the changed-file inventory but not the changed test ranges, because the pre-step only tracks C# tests. I did not assess its modified cases, so that group is unassessed.
🧵 Parallel safety
NOT_APPLICABLE: no changed tests or parallelization configuration were in scope.
Per-test assessment
No changed C# test methods, so there is nothing to grade (Not applicable).
<sub>This advisory review is heuristic and non-blocking.
Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>
🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~24 AIC · ⌖ ~1 AIC · ⊞ 8K
Pull request
Summary
Agentic test reviews can complete analysis and threat detection but fail before publication with
Report nodes cannot appear in scalar fields, as in run 41640057298. Five inspected runs share this failure. The expert reviewer also cannot read unapproved PR diffs under its default public-repository integrity policy.{history_link}directly as the pinned runtime's complete optional inline fragment in all 32 affected footer templates, and regenerate their locks./reviewPR identity through a supported environment binding and require a terminal incomplete result when the diff is unavailable.Design and decision record
This is a runtime-contract repair, not a new feature. The maintained workflow rationale and regression evidence records the failures and chosen approach; the expert-review input contract explains two non-obvious compiler constraints.
The imported prompt rejects direct
fromJSON(...), so the fallback is resolved in frontmatterenv.REVIEW_PR_NUMBER. Setting onlymin-integrity: nonechanges the repository-scope default toall, soallowed-repos: publicis explicit. Neither disabling footers nor upgrading/patching the upstream renderer is necessary. All 29 non-expert generated locks change only the intended footer values and frontmatter hashes. Action/container pins and dependency manifests are unchanged.Demonstration
The composed regression supplies the authored footer to the real PR-review buffer, renderer, and size-fitting path. Without the fix it throws before
createReview; with the fix it produces the exact advisory review body, attribution, credit suffix, and reviewed commit. Separate cases preserve inline comment path/line associations and suppress publication for staged or empty output.A text reproduction is clearer than a screenshot for this failure. No live workflow or test review was dispatched. Hosted MCP/model behavior, publication permissions, and GitHub UI rendering remain unverified; captured publishing payloads are not visual proof.
Validation and regression proof
Tested source:
d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6; committed from the 68 files whose working-file hashes matched the final validated manifest before commit. Baseline:d9e38dc463365dc12f714db14815b46dedb0ed15, extracted into an isolated archive with the final regression tests retained.Toolchain: released gh-aw v1.0.1; unchanged setup scripts at
221ba4f4319de6b8e809d1a15528b3ae6a818aa5; Node.js v24.22.1; ShellCheck v0.11.0.$ghAwdenotes the verified released compiler,$actionsthe pinned setup scripts,$moduleitsfirewall_blocked_domains.cjs, and$baselinethe isolated archive's.github\workflowsdirectory.& $ghAw compile --strict --no-check-update --shellcheck& $ghAw compile review-on-open.agent review.agent review-after-autofix.agent --strict --no-check-update --shellcheckpython .github\scripts\check_action_pins.pypython .github\scripts\test_gh_aw_runtime_contracts.py --actions-dir $actions -vpython .github\scripts\test_agentic_workflow_warning_contracts.py -vpython .github\scripts\test_build_failure_analysis_checkout.py -vpython .github\scripts\test_gh_aw_firewall_footer.py --module-path $module -vpython -m unittest discover -s .github\workflows\tests -p test_test_value_evidence.py -vTotal: 77 passing methods, no skips. Raw local logs are retained in the session; the committed README contains reproducible commands and the evidence summary. A single read-only safety reviewer passed all ten properties for the final executable changes. No .NET products or packages changed, so .NET build/pack/acceptance runs were not required. Hosted validation and release-branch/backport work are not claimed.
Test-value evidence
GhAwRuntimeContractTests.test_authored_test_review_footer_publishes_complete_advisory_reviewGhAwRuntimeContractTests.test_public_review_resolver_honors_explicit_public_only_policyapproved, notnone.nonewith repository visibility stillpublic.test_centralized_review_number_is_delivered_to_each_compiled_promptandtest_required_diff_failure_has_terminal_incomplete_prompt_deliveryPaired commands used the same final tests, assertions, runtime, and selection: